<?php /*
Template Name: FrontPage
*/ ?>

<?php get_header(); ?>

<div id="page">

<?php if(is_home()) :
	if( simpax_greetings() ) :
		// hallo user!
		if( isset($_COOKIE['comment_author_'.COOKIEHASH]) ) {
			$comment_author = $_COOKIE['comment_author_'.COOKIEHASH]; ?>
	      <h3 class="container">Hallo <?php echo $comment_author; ?>!
	      Sch&ouml;n, dass du wieder da bist! <small><?php wp_register('','/'); ?><?php wp_loginout(); ?>?</small></h3>
		<?php } else if ( $user_identity ) { ?>
	      <h3 class="container">Hallo <?php echo $user_identity; ?>!
	      Sch&ouml;n, dass du wieder da bist!
 	      <small> &bull <?php wp_register('',' &bull; '); ?><?php wp_loginout(); ?></small></h3>
		<?php };
	endif;
endif;
?>

<?php /****** POST ******/ ?>

<?php if(simpax_asides()) : $asides_cat = simpax_get_asides_cat(); $asides = "&cat=-{$asides_cat}";
	else : $asides = '';
	endif;
?>

<?php query_posts('showposts=1$asides'); ?>
<?php if (have_posts()) :
      while (have_posts()) : the_post(); ?>
	  
<h2 class="title-post">
<a href="<?php the_permalink(); ?>" title="<?php _e('Artikelseite von','simpax');?> <?php the_title(); ?>" class="title-span"><?php the_title(); ?></a>
</h2>

<div class="accordion">

<?php if( simpax_date() == "top" ) : ?>

<div class="date_alt">
Geschrieben am <?php the_time('d. M Y'); ?>, bisher 
<?php if(simpax_cmt_number()) { ?>
<?php comments_popup_link(__('0 Kommentare','simpax'), __('ein Kommentar','simpax'), '% '.__('Kommentare','simpax'), '', ''); ?>
<?php } ?>
<?php if(simpax_editlink()) { ?>
	<?php edit_post_link(' &bull; '.__('Artikel bearbeiten','simpax')); ?>
<?php } ?>
</div>

<?php endif; ?>

<?php if( simpax_date() == "right" ) : ?>

<div class="date">
	<span class="date_day"><?php the_time('d'); ?></span>
	<span class="date_month"><?php the_time('M'); ?></span>
	<span class="date_year"><?php the_time('Y'); ?></span>
	<?php if(simpax_cmt_number()) { ?>
	<span class="date_comments">
	<?php comments_popup_link('<img src="'.get_bloginfo(stylesheet_directory).'/img/comment.png" alt="'.__('Kommentare','simpax').'" /> 0', '<img src="'.get_bloginfo(stylesheet_directory).'/img/comment.png" alt="'.__('Kommentare','simpax').'" /> 1', '<img src="'.get_bloginfo(stylesheet_directory).'/img/comment.png" alt="'.__('Kommentare','simpax').'" /> %', '', ''); ?>
	</span>
	<?php } ?>
	<?php if(simpax_editlink()) { ?>
	<?php edit_post_link('<img src="'.get_bloginfo(stylesheet_directory).'/img/pencil.png" alt="edit" /> e','<span class="date_comments">', '</span>'); ?>
	<?php } ?>
</div>

<?php endif; ?>

<div class="post">
<?php the_content(__('Den kompletten Artikel lesen &raquo;','simpax')); ?>
</div>

<?php if( simpax_date() == "bottom" ) : ?>

<div class="date_alt">
Geschrieben am <?php the_time('d. M Y'); ?>, bisher 
<?php if(simpax_cmt_number()) { ?>
<?php comments_popup_link(__('0 Kommentare','simpax'), __('ein Kommentar','simpax'), '% '.__('Kommentare','simpax'), '', ''); ?>
<?php } ?>
<?php if(simpax_editlink()) { ?>
	<?php edit_post_link(' &bull; '.__('Artikel bearbeiten','simpax')); ?>
<?php } ?>
</div>

<?php endif; ?>

<?php endwhile;
	else : ?>
<h2 class="title-post"><?php _e('Leider keine Artikel vorhanden...','simpax');?></h2>
<?php endif; ?>

<?php /****** FOOTER ******/ ?>
<br style="clear:both;" />
<h2 class="title-post"><a href="?page_id=17">zum Blog</a></h2>
<?php /****** ASIDES ******/ ?>

<?php if(simpax_asides()) : $asides_cat = simpax_get_asides_cat(); $asides = "&cat={$asides_cat}"; ?>

<?php query_posts('showposts=2$asides'); ?>

<?php if (have_posts()) :
      while (have_posts()) : the_post(); ?>
	  
<div class="asides">
	<?php echo wptexturize($post->post_content); ?>
	<a href="<?php the_permalink() ?>" rel="bookmark">&laquo;</a>
</div>

<?php endwhile;
	else : ?>
<h2 class="title-post"><?php _e('Leider keine Artikel vorhanden...','simpax');?></h2>
<?php endif; ?>

<?php endif; ?>

</div>
</div>

<?php get_footer(); ?>